﻿using MvcMedicalProvider.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcMedicalProvider.Helpers
{
    public static class UIHelper
    {
        public static string GetGenderFromDbValue(string gender)
        {
            if (string.IsNullOrEmpty(gender)) return "";

            return string.Compare(gender, "M", StringComparison.OrdinalIgnoreCase) == 0 ? "Male" : "Female";
        }

        public static string GetProviderName(ProviderInfo proInfo)
        {
            return string.Format("{0}, {1}, {2}", proInfo.nppes_provider_last_org_name, proInfo.nppes_provider_first_name, proInfo.nppes_credentials);
        }

        public static string GetProviderMoney(decimal? money)
        {
            if (!money.HasValue) return "";
            if (money.Value == -1) return "*";
            return money.Value.ToString("C2");
        }
    }
}